{% extends "data_list.html" %}
{% load i18n %}
{% block headjs %}
<script type="text/javascript" src="/media/jslib/calculateReport.js"></script>
{% endblock %}
{% block getdatalist %}
$("body").append("<div id='gz_processStatus' style='position: absolute; display:none; top: 0px; left: 0px; width:100%; height:100%; opacity: 0.6;filter:alpha(opacity=60); z-index:999999; background-color:#000000;'></div>"
                    +"<div id='show_process_status' style='display: none; position: absolute; line-height: 200px;  text-align: center; left: 35%; top: 40%; background-color:#E8F5FE;border:6px solid #A9C9E2; padding:0px 0px 10px 0px; z-index:999999'><div style='border:0px solid #A9C9E2; margin:1px 1px 5px 1px; font-size:14px; padding:2px; background-color:#CEEBFB'>"+gettext('考勤计算进度')+"</div>" +"<div id='detail_process' style='margin-bottom:3px;'>"
                       +"<table style='border:1'><tr><td width='130px' align='right'>"+gettext("已计算人数:")+"<label id='labledetail'></label></td><td width='130px' align='right'>"+gettext("待计算人数:")+"<label id='lablewait'></label></td></tr></table>"
                    +"</div><div id='total_process'>"
                       +"<table><tr><td width='130px' align='right'>"+gettext("总进度")+"</td><td width='200px' align='left' style='padding-top:3px;'><span class='progressBar' id='spaceusedtol'>0%</span></td></tr></table>"
                    +"</div></div>");

{% endblock %}
{% block content %}
{% endblock %}
{% block addjs %}
{% if "SECURITY_AND_ZKECO"|filter_config_option or "USE_ABROAD_ATT"|filter_config_option %}
    $(".leftBox").remove();
{% endif %}
function OnRefreshComProgress()
    {
        var stamp0 = new Date().getTime();
        $.ajax({
            url: "/att/{{ request.surl }}data_progressbar/?reqid=",
            type: "GET",
            dataType: "json",
            success: function(pgdata)
            {
//                alert(pgdata.data[0])
                if(pgdata)
                {
                    if (pgdata.index > 0)
                    {
                        rtlisthtml = "";
                        datas = pgdata.data[0];
                        $("#labledetail").text(datas['progress']);
						 $("#lablewait").text(datas['wait']);
                        if(temp_detail != datas['progress'])
                        {
                            //alert(datas['progress']);
                            $("#spaceuseddetail").progressBar(datas['progress'], {increment:100,barImage: '/media/images/progressbg_green.gif?'+stamp0});
                            temp_detail = datas['progress'];

                        }
                        if(temp_tol != datas['tolprogress'])
                        {
                            $("#spaceusedtol").progressBar(datas['tolprogress'], {barImage: '/media/images/progressbg_green.gif?'+stamp0});
                            temp_tol = datas['tolprogress'];
                        }
                        $("#show_process_status").show();
                        $("#gz_processStatus").show();

                    }
                    else if (pgdata.index == 0)
                    {
                        $("#show_process_status").hide();
                        $("#gz_processStatus").hide();
                        $("#spaceuseddetail").progressBar(0, {increment:100,barImage: '/media/images/progressbg_green.gif?'+stamp0});
                        $("#spaceusedtol").progressBar(0, {increment:100,barImage: '/media/images/progressbg_green.gif?'+stamp0});
                        clearInterval(progress_interval);

                    }
                }
            }
        });
    }
{% if initLoad %}
    window.onload = {{ initLoad }}
{% else %}
{% if request.user|HasPerm:"att.calcresultdetail_attreportperms" or request.session.employee %}
	window.onload = AttRecAbnormite
{%else%}
	{% if request.user|HasPerm:"att.earchdayattreport_attreportperms" or request.session.employee %}
		window.onload = DailyReport
	{%else%}
		{% if request.user|HasPerm:"att.attshiftsattreport_attreportperms" or request.session.employee %}
		  window.onload = AttShifts
		{%else%}
			{% if request.user|HasPerm:"att.calctotalreport_attreportperms" or request.session.employee %}
			  window.onload = CalculateReport
			{%else%}
				{% if request.user|HasPerm:"att.leavetotalreport_attreportperms" or request.session.employee %}
				  window.onload = LeaveReport
				{%else%}
					{% if request.user|HasPerm:"att.firstlastreport_attreportperms" or request.session.employee %}
						window.onload = LEReport
					{%else%}
						{% if request.user|HasPerm:"att.exceptionreport_attreportperms" or request.session.employee %}
							window.onload = YCReport
                        {%else%}
                            {% if request.user|HasPerm:"att.deptattsumreport_attreportperms" or request.session.employee %}
                                window.onload = DeptAttSumReport
                            {%else%}
                                window.onload = CardTimesReport
                            {% endif %}
                        {% endif %}
					{% endif %}
				{% endif %}
			{% endif %}
		{% endif %}
	{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% block content_end %}
<div style="margin:0px 10px 10px 10px;">
	<input type="hidden" id="id_current_report" value="1" />
	<input type="hidden" id="id_all_emp" value="{%filter_leave_emp%}"/>
	<div id="id_divsearch" class="calculate_divsearch">
		<div style="margin:0px 10px 5px 10px;">
		<form id="id_calculateform" method="post">
		<div class="news_topsearch">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		        <tr>
			        <td width="50"><div class="news_topsearch1">{% trans '查询' %}</div></td>
			        <td>
			        	<div class="news_topsearch2">
						<table>
							<tr>
						{% block select_emp %}		
								{% autoescape off %}
                                <td class="displayN" name="dept"><div class="lineH22">{{ deptfield|field_as_label_tag }}</div></td><td class="displayN" name="dept">{{deptfield.as_widget}}</td>
								<td name = "emp"><div class="lineH22">{{ empfield|field_as_label_tag_no_asterisk }}</div></td><td name = "emp">{{empfield.as_widget}}</td>
								{% endautoescape %}
					{% endblock %}
								<td><div class="lineH22">&nbsp;&nbsp;{% trans "开始日期" %}</div></td><td><input type="text" class="date dp-applied"  format="yyyy-MM-dd" readonly="True" name="ComeTime" id="id_cometime"/></td>
								<td><div class="lineH22">&nbsp;&nbsp;{% trans "结束日期" %}</div></td><td><input type="text" class="date dp-applied" format="yyyy-MM-dd" readonly="True" name="EndTime" id="id_endtime"/></td>
								<td><div style="margin:0px 0px 0px 5px;"><span class="action_Search">&nbsp;</span><a id="id_query" href="javascript:void(0)" class="Link_blue1" >{% trans '查询' %}</a></div></td>
				
									<td><div style="margin:0px 0px 0px 5px;"><span class="action_calculate">&nbsp;</span><a id="id_calculate" href="javascript:void(0)" class="Link_blue1">{% trans '统计' %}</a></div></td>
				
							
							</tr>
							<tr><td colspan="3">
							<div id="id_ReturnMsg" class="div_ReturnMsg"></div></td>
							</tr>
							</table>
			<input type="hidden" name="DeptIDs" value="" />
			<input type="hidden" name="isForce" value="0" />
			<input type="hidden" name="UserIDs" value="" />
			<input type="hidden" name="dept_child" id="dept_child" value="0" />
			</div></td>
            </tr>
            </table>
		</div>	
		</form>
		</div>
	</div>
	<div id="calculatetabs" style="margin-right: 20px;margin-left: 20px;">
	    <ul class="tabs">
		{% if request.user|HasPerm:"att.calcresultdetail_attreportperms" or request.session.employee %}
          <li><a id="AttRecAbnormite" href="javascript:void(0)" class="current" onClick="AttRecAbnormite('')">{% trans '统计结果详情' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.earchdayattreport_attreportperms" or request.session.employee %}
          <li><a id="DailyReport" href="javascript:void(0)" onClick="DailyReport('')">{% trans '每日考勤统计表' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.attshiftsattreport_attreportperms" or request.session.employee %}
          <li><a id="AttShifts" href="javascript:void(0)" onClick="AttShifts('')">{% trans '考勤明细表' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.calctotalreport_attreportperms" or request.session.employee %}
          <li><a id="CalculateReport" href="javascript:void(0)" onClick="CalculateReport('')">{% trans '考勤汇总表' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.leavetotalreport_attreportperms" or request.session.employee %}
		  <li><a id="LeaveReport" href="javascript:void(0)" onClick="LeaveReport('')">{% trans '请假汇总表' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.firstlastreport_attreportperms" or request.session.employee %}
			<li><a id="LEReport" href="javascript:void(0)" onClick="LEReport('')">{% trans '汇总最早与最晚' %}</a></li>
		{% endif %}
		{% if request.user|HasPerm:"att.exceptionreport_attreportperms" or request.session.employee %}
			<li><a id="YCReport" href="javascript:void(0)" onClick="YCReport('')">{% trans '考勤异常明细表' %}</a></li>
		{% endif %}
        {% if request.user|HasPerm:"att.deptattsumreport_attreportperms" or request.session.employee %}
            <li><a id="DeptAttSumReport" href="javascript:void(0)" onClick="DeptAttSumReport('')">{% trans '部门汇总表' %}</a></li>
        {% endif%}
		{% if request.user|HasPerm:"att.cardtimesreport_attreportperms" or request.session.employee %}
			<li><a id="CardTimesReport" href="javascript:void(0)" onClick="CardTimesReport('')">{% trans '打卡详情表' %}</a></li>
		{% endif %}
	    </ul>
		<div class="attCalculatediv" id="caltabs" >
			<div id="grid_frame_div" scrolling="0" style="_height:1%">
			<iframe src="" id="grid_frame" frameborder="0" scrolling="0" width="100%" height="450"></iframe>
			</div>
		</div>
			
	</div>
</div>
<div id="id_attexcept_desc"></div>
{% block selfservices %} {% endblock %}
{% endblock %}